package com.travel.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDate;
import lombok.Data;

/**
 * 酒店订单
 * @TableName hotel_order
 */
@TableName(value ="hotel_order")
@Data
public class HotelOrder implements Serializable {
    /**
     * 订单id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 酒店id
     */
    @TableField(value = "hotel_id")
    private Integer hotelId;

    /**
     * 酒店名称
     */
    @TableField(value = "hotel_name")
    private String hotelName;

    /**
     * 酒店未知
     */
    @TableField(value = "address")
    private String address;

    /**
     * 房间id
     */
    @TableField(value = "room_type")
    private Integer roomType;

    /**
     * 入住时间
     */
    @TableField(value = "check_in_time")
    private LocalDate checkInTime;

    /**
     * 退房时间
     */
    @TableField(value = "check_out_time")
    private LocalDate checkOutTime;

    /**
     * 房间数量
     */
    @TableField(value = "room_count")
    private Integer roomCount;

    /**
     * 住客名字
     */
    @TableField(value = "guest_name")
    private String guestName;

    /**
     * 邮件
     */
    @TableField(value = "email")
    private String email;

    /**
     * 用户id
     */
    @TableField(value = "userId")
    private Integer userid;

    /**
     * 住客电话
     */
    @TableField(value = "phoneNumber")
    private Integer phonenumber;

    /**
     * 预计到店时间
     */
    @TableField(value = "expect_time")
    private LocalDate expectTime;

    /**
     * 特别要求
     */
    @TableField(value = "special_requirement")
    private String specialRequirement;

    /**
     * 总价
     */
    @TableField(value = "total_price")
    private Integer totalPrice;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        HotelOrder other = (HotelOrder) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getHotelId() == null ? other.getHotelId() == null : this.getHotelId().equals(other.getHotelId()))
            && (this.getHotelName() == null ? other.getHotelName() == null : this.getHotelName().equals(other.getHotelName()))
            && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
            && (this.getRoomType() == null ? other.getRoomType() == null : this.getRoomType().equals(other.getRoomType()))
            && (this.getCheckInTime() == null ? other.getCheckInTime() == null : this.getCheckInTime().equals(other.getCheckInTime()))
            && (this.getCheckOutTime() == null ? other.getCheckOutTime() == null : this.getCheckOutTime().equals(other.getCheckOutTime()))
            && (this.getRoomCount() == null ? other.getRoomCount() == null : this.getRoomCount().equals(other.getRoomCount()))
            && (this.getGuestName() == null ? other.getGuestName() == null : this.getGuestName().equals(other.getGuestName()))
            && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
            && (this.getUserid() == null ? other.getUserid() == null : this.getUserid().equals(other.getUserid()))
            && (this.getPhonenumber() == null ? other.getPhonenumber() == null : this.getPhonenumber().equals(other.getPhonenumber()))
            && (this.getExpectTime() == null ? other.getExpectTime() == null : this.getExpectTime().equals(other.getExpectTime()))
            && (this.getSpecialRequirement() == null ? other.getSpecialRequirement() == null : this.getSpecialRequirement().equals(other.getSpecialRequirement()))
            && (this.getTotalPrice() == null ? other.getTotalPrice() == null : this.getTotalPrice().equals(other.getTotalPrice()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getHotelId() == null) ? 0 : getHotelId().hashCode());
        result = prime * result + ((getHotelName() == null) ? 0 : getHotelName().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getRoomType() == null) ? 0 : getRoomType().hashCode());
        result = prime * result + ((getCheckInTime() == null) ? 0 : getCheckInTime().hashCode());
        result = prime * result + ((getCheckOutTime() == null) ? 0 : getCheckOutTime().hashCode());
        result = prime * result + ((getRoomCount() == null) ? 0 : getRoomCount().hashCode());
        result = prime * result + ((getGuestName() == null) ? 0 : getGuestName().hashCode());
        result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
        result = prime * result + ((getUserid() == null) ? 0 : getUserid().hashCode());
        result = prime * result + ((getPhonenumber() == null) ? 0 : getPhonenumber().hashCode());
        result = prime * result + ((getExpectTime() == null) ? 0 : getExpectTime().hashCode());
        result = prime * result + ((getSpecialRequirement() == null) ? 0 : getSpecialRequirement().hashCode());
        result = prime * result + ((getTotalPrice() == null) ? 0 : getTotalPrice().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", hotelId=").append(hotelId);
        sb.append(", hotelName=").append(hotelName);
        sb.append(", address=").append(address);
        sb.append(", roomType=").append(roomType);
        sb.append(", checkInTime=").append(checkInTime);
        sb.append(", checkOutTime=").append(checkOutTime);
        sb.append(", roomCount=").append(roomCount);
        sb.append(", guestName=").append(guestName);
        sb.append(", email=").append(email);
        sb.append(", userid=").append(userid);
        sb.append(", phonenumber=").append(phonenumber);
        sb.append(", expectTime=").append(expectTime);
        sb.append(", specialRequirement=").append(specialRequirement);
        sb.append(", totalPrice=").append(totalPrice);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}